#ifndef _GUARD_H_UART_SHELL_H_
#define _GUARD_H_UART_SHELL_H_

#include <stdint.h>
#include <iot_uart.h>

typedef enum {
  UART_RECV_MSG = 1,
  TRANSPORT_RECV_TIMER_TIMEOUT = 2,
}TASK_MSG_ID;

typedef struct {
  TASK_MSG_ID id;
  uint32_t len;
  void *param;
}TASK_MSG;

#define SHELL_UART_PORT OPENAT_UART_USB
#define THREAD_PRIORITY_SHELL 11
#define SHELL_UART_RECV_TIMEOUT (5 * 1000) // 5S

void start_uart_svr();
void cloud_uart_received(const char* buf, int length);

void start_uart_shell();
void shell_uart_open(PUART_MESSAGE handler);
void shell_uart_recv_handle(T_AMOPENAT_UART_MESSAGE* evt);

void push_cmd(const char* buf, int32_t length);
#endif

